<!DOCTYPE html>
<html lang="en">
<head>
<title>公共平台</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- 样式文件的引入 -->
<link href="commons/css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css"
	href="commons/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="commons/themes/icon.css">
	<!-- jqueryUI JS文件的引入 -->
<script type="text/javascript" src="commons/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="commons/js/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="commons/js/fusioncharts/JSClass/fusionCharts.js"></script>
<script type="text/javascript"
	src="commons/js/easyui-extends-validate.js"></script>
<!-- jqueryUI国际化 -->
<script type="text/javascript" src="commons/js/easyui-lang-zh_CN.js"></script>
<!-- 开发使用的公用js方法 -->
<script type="text/javascript" src="commons/js/common.js"></script>
<!-- 开发国际化的引用，主要完成后台信息在前台提示的国际化，一定要放在最后 -->
<script type="text/javascript">var ctx = '/comm-user-auth-server';var actionExt = "action";var i18n = new Object();</script>
<script src="commons/js/i18n/message_zh_CN.js" type="text/javascript"></script>
</head>

<body>
	<div class="easyui-layout" data-options="fit:true,border:true">
		<div data-options="region:'north',border:true"
			style="overflow: hidden;">
			<div class="queryContent" style="height: 36px;">
				<form name="searchWarnForm" id="searchWarnForm" method="post" action="">
					<table class="queryTable">
						<tbody>
							<tr>
								<th width="70%">所属模块</th>
								<td width="10%"><input id="selWarnSysCodeCombobox"
									name="sysCode" class="easyui-combobox"
									data-options="
					        panelHeight:'auto',
					        valueField: 'id',
					        textField: 'text',
					        width:'150px',
					        animate:true"></td>
								<th width="100">操作时间</th>
								<td width="10%"><input id="startTime"
									class="easyui-datetimebox" type="text" name="startTime"
									data-options="validType:['dateTimeLessCompare[\'endTime\']']"
									maxlength="20" style="width: 140px" />-<input id="endTime"
									class="easyui-datetimebox" type="text"
									data-options="validType:['dateTimeMoreCompare[\'startTime\']']"
									name="endTime" maxlength="20" style="width: 140px" /></td>
								<td align="right" width="10%"><a href="javascript:void(0);" onclick="summary();"
									class="easyui-linkbutton" id="search" plain="true">查询</a></td>
							</tr>
						</tbody>
					</table>
				</form>
			</div>
		</div>
		<div data-options="region:'center',border:true"
			style="text-align: center;">
			<div style="width: 980px; padding: 40px; margin: 0 auto">
				<table style="width: 1000px;">
					<tr>
						<td width="50%"><div id='chartdiv_01'
								style="width: 500px; height: 600px;" /></td>
						<td width="50%"><div id='chartdiv_02'
								style="width: 500px; height: 600px;" /></td>
					</tr>
				</table>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
		//初始化表格对应的js对象
		$(function() {
			//初始化表格对象数据
			 //下拉选项初始化
	        $.getJSON('/comm-dictionary-server/dictionaryManage/listSys?parentValue=sys_code',function(jsonData){
	            $('#selWarnSysCodeCombobox').combobox({
	                data:jsonData.data,
	                valueField:'value',
	                textField:'name'
	            });
	        });
	        summary();
		});
		var myChart = new FusionCharts("commons/js/fusioncharts/Charts/Column2D.swf", "myChartId_02", "500", "600");
		var mydata = {"chart":{"showborder": "0",
			  "numberprefix": "",
			  "caption": "用户操作记录统计图",
			  "yaxisname": "统计量",
			  "bgcolor": "FFFFFF,FFFFFF",
			  "useroundedges": "1"
			  },"data":[{value: 100,label: "添加"},{value: 200,label: "删除"},{value: 200,label: "修改"},{value: 200,label: "查询"},{value: 200,label: "其他"}]
		}
		function summary(){
			logSummary();
	        logWarnSummary();
		}
	  function logSummary(){
		  $.ajax({
				type: "post",
				timeout:20000,
				url:'/comm-user-auth-server/log/logOpSummary',
				data:$("#searchWarnForm").serialize(),
				success: function(resultData,res){
					if(resultData.success == true){
						mydata.data = resultData.data;
						myChart.setJSONData(mydata);
					  	myChart.render("chartdiv_01");
					}
				},
				error: function(res){
					var msn = ''||i18n[''];
					$.messager.alert('提示',i18n.requestError,'error');
				}
			});
	 }
	 var mypie = new FusionCharts("commons/js/fusioncharts/Charts/Pie2D.swf", "myPieId_02", "500", "600");
	 var myPiedata = {"chart":{"showborder": "0",
		  "numberprefix": "",
		  "caption": "用户操作结果统计图",
		  "yaxisname": "统计量",
		  "bgcolor": "FFFFFF,FFFFFF",
		  "useroundedges": "1"
		  },"data":[{value: 100,label: "添加"},{value: 200,label: "删除"},{value: 200,label: "修改"},{value: 200,label: "查询"},{value: 200,label: "其他"}]
	}
	function logWarnSummary(){
		 $.ajax({
				type: "post",
				timeout:20000,
				url:  '/comm-user-auth-server/log/logOpExceptionSummary',
				data:$("#searchWarnForm").serialize(),
				success: function(resultData,res){
					if(resultData.success == true){
						myPiedata.data = resultData.data;
						mypie.setJSONData(myPiedata);
					  	mypie.render("chartdiv_02");
					}
				},
				error: function(res){
					var msn = ''||i18n[''];
					$.messager.alert('提示',i18n.requestError,'error');
				}
			});
	}
			
	</script>
</body>
</html>
